<template>
    <van-form @submit="onSubmit">
        <van-cell-group inset>
            <van-field v-model="username" name="username" label="姓名" placeholder="姓名"
                :rules="[{ required: true, message: '请填写用户名' }]" />
            <van-field v-model="password" type="password" name="password" label="电话" placeholder="电话"
                :rules="[{ required: true, message: '请填写密码' }]" />
                 <van-field v-model="username" name="username" label="地区" placeholder="地区"
                :rules="[{ required: true, message: '请填写用户名' }]" />
            <van-field v-model="password" type="password" name="password" label="详细地址" placeholder="详细地址"
                :rules="[{ required: true, message: '请填写密码' }]" />
                 <van-field v-model="username" name="username" label="邮政编码" placeholder="邮政编码"
                :rules="[{ required: true, message: '请填写用户名' }]" />
        </van-cell-group>
        <p>  设为默认地址 <van-switch v-model="checked"/></p>
       
          
      
        <div style="margin: 16px;">
            <van-button round block type="primary" native-type="submit">
                保存
            </van-button>
        </div>
    </van-form>
</template>

<script setup>
import { ref } from 'vue';
  const checked = ref(true);
  import { useRouter, useRoute } from 'vue-router';
const router = useRouter()
const onSubmit = () => {
    router.push('/home/cart')
}
</script>

<style lang="scss" scoped></style>